package com.kgcx.common.utils;

import java.util.Random;

/**
 * Created by Paul on 2017/11/10.
 */
public class UUIDUtils {

    /**
     * 生成18位随机数字串
     *
     * @return
     */
    public static String getOrderSnByTime18() {
        String s = (System.currentTimeMillis() + "").substring(1) + (System.nanoTime() + "").substring(7, 10);
        Random rm = new Random();
        double pross = (1 + rm.nextDouble()) * Math.pow(10, 12);
        String fixLenthString = String.valueOf(pross);
        return s + fixLenthString.substring(2, 5);
    }

    public static void main(String[] args) {
        System.out.println(getOrderSnByTime18());
    }
}
